<template>
  <div class="resume_manage">
    <div class="download">
      <div class="collection" @click="collection">
        <i :class="['icon',{'active':collected}]"></i> {{collected?'取消收藏':'收藏'}}
      </div>
      <div class="btnBox">
        <el-button type="text" @click="reportVisible=true" class="reportBox">举报</el-button>
        <el-button type="primary" @click="downloadResume" :loading="loading">下载简历</el-button>
        <el-button type="primary" plain @click="deleteResume" v-if="invite">删除简历</el-button>
        <el-button type="primary" plain @click="chatVisible=true">{{continuChat?'继续联系':'发起聊天'}}</el-button>
      </div>
    </div>
    <h1>简历详情</h1>
    <div class="resumeInfo" id="pdfContent" ref="print">
      <div class="personalInfo">
        <div class="personalContent">
          <img :class="[form.sex!==1?'girl':'']" :src="form.photoAuditStatus===1?form.photo:''" alt />
          <div class="info">
            <h3 class="item">{{form.name}}</h3>
            <p class="item">
              <span v-if="form.sexText">{{form.sexText}}&nbsp;</span>
              <span v-if="form.birthday">
                |
                {{new Date().getFullYear()-parseInt(form.birthday)}}岁（{{form.birthday.slice(0,10)}}）&nbsp;
              </span>
              <span v-if="form.educationText">| {{form.educationText}}&nbsp;</span>
              <span v-if="form.maritalStatusText">| {{form.maritalStatusText}}&nbsp;</span>
              <span v-if="form.workExpText||form.workTime">|
                工作{{form.workExpText?form.workExpText:form.workTime}}&nbsp;</span>
              <span v-if="form.nationText">| {{form.nationText}}&nbsp;</span>
            </p>
            <p class="item">
              <span v-if="form.currentResidenceText">现居住地：{{form.currentResidenceText}}&nbsp;</span>
              <span v-if="form.domicilePlaceText">| 户籍地：{{form.domicilePlaceText}}&nbsp;</span>
              <span v-if="form.politicalStatusText">| {{form.politicalStatusText}}&nbsp;</span>
            </p>
            <p class="item">
              <span v-if="form.height">身高：{{form.height}}cm&nbsp;</span>
              <span v-if="form.weight&&form.weight!=='null'">| 体重{{form.weight}}kg&nbsp;</span>
              <span v-if="form.visionText">| 视力状况：{{form.visionText}}&nbsp;</span>
            </p>
            <p class="item">
              <span v-if="form.titleLevelText">职称级别：{{form.titleLevelText}}</span>
            </p>
          </div>
        </div>
      </div>
      <el-tabs v-model="activeName">
        <el-tab-pane label="个人信息" name="first">
          <div class="resumeBox">
            <div class="mp" v-if='didInappropriate'>
              <h4 class="item">联系信息</h4>
              <div class="titleBor item"></div>
              <div class="select">
                <div class="select item">
                  <el-button type="primary" @click="()=>{didInvite&&didRefuse&&didIntent?intention():null}"
                    :disabled="!(didInvite&&didRefuse&&didIntent)" v-if="invite">有意向</el-button>
                  <el-button type="success" @click="()=>{didInvite&&didRefuse&&didIntent?inviteInterview():null}"
                    :disabled="!(didInvite&&didRefuse&&didIntent)">邀请面试</el-button>
                  <el-button type="primary" plain @click="()=>{didInvite&&didRefuse&&didIntent?refuse():null}"
                    :disabled="!(didInvite&&didRefuse&&didIntent)" v-if="invite">不合适</el-button>
                </div>
                <p v-show="!contact" class="item">您需要给出反馈后才展示联系方式，请点击上方按钮进行反馈</p>
              </div>
              <div class="sub-box" v-show="contact">
                <div class="item" v-if="form.phone">手机号码：{{form.phone}}</div>
                <div class="item" v-if="form.mail">邮箱：{{form.mail}}</div>
                <div class="item" v-if="form.qq">QQ号：{{form.qq}}</div>
                <div class="item" v-if="form.wechat">微信号：{{form.wechat}}</div>
                <div class="item" v-if="form.mailingAddress">通讯地址：{{form.mailingAddress}}</div>
                <div class="item" v-if="form.homepage">
                  个人主页：
                  <a :href="form.homepage" target="_blank">{{form.homepage}}</a>
                </div>
              </div>
            </div>
            <div class="mp">
              <h4 class="item">职位描述</h4>
              <div class="titleBor item"></div>
              <div class="desc item">
                <div>
                  <p v-if="form.currentStatusText">目前状态：{{form.currentStatusText}}</p>
                  <p v-if="form.workPlaceText">期望工作地点：{{form.workPlaceText}}</p>
                  <p>是否需要技能培训：{{form.needTrain?'是':'否'}}</p>
                </div>
                <div>
                  <p v-if="form.hopeJobText">期望职位：{{form.hopeJobText}}</p>
                  <p v-if="form.workModeText">期望工作方式：{{form.workModeText}}</p>
                </div>
                <div>
                  <p v-if="form.hopeTradeText">期望行业：{{form.hopeTradeText}}</p>
                  <p v-if="form.hopeWage">期望薪资：{{form.hopeWage}}</p>
                </div>
              </div>
            </div>
            <div class="mp education" v-if="form.eduInfoOutVos&&form.eduInfoOutVos.length>0">
              <h4 class="item">教育经历</h4>
              <div class="titleBor item"></div>
              <p class="item" v-for="(item,i) in form.eduInfoOutVos" :key="i">
                <span v-if="item.eduTime">{{item.eduTime}}&nbsp;</span>
                <span v-if="item.school">| {{item.school}}&nbsp;</span>
                <span v-if="item.major">| {{item.major}}</span>
                <span v-if="item.educationText">| {{item.educationText}}</span>
              </p>
            </div>
            <div class="mp" v-if="form.workInfoOutVos&&form.workInfoOutVos.length>0">
              <h4 class="item">工作经历</h4>
              <div class="titleBor item"></div>
              <div v-for="(item,i) in form.workInfoOutVos" :key="i" class="borBottom">
                <div class="jobBox item">
                  <div class="label">{{item.workTime}}</div>
                  <div class="translate">{{item.company}}</div>
                </div>
                <div class="jobBox item" v-if="item.job">
                  <div class="label">职位名称</div>
                  <div class="translate">{{item.job}}</div>
                </div>
                <div class="jobBox item" v-if="item.preTaxWage">
                  <div class="label">月薪</div>
                  <div class="translate">{{item.preTaxWage}}</div>
                </div>
                <div class="jobBox item" v-if="item.remark">
                  <div class="label">工作职责</div>
                  <div class="translate">{{item.remark}}</div>
                </div>
                <div class="contentBor item"></div>
              </div>
            </div>
            <div class="mp" v-if="form.lagInfoOutVos&&form.lagInfoOutVos.length>0">
              <h4 class="item">语言能力</h4>
              <div class="titleBor item"></div>
              <div class="lang item" v-for="(item,i) in form.lagInfoOutVos" :key="i">
                <p>语言：{{item.languageText}}</p>
                <p>熟练程度：{{item.proficiencyText}}</p>
              </div>
            </div>

            <div class="mp" v-if="form.trainInfoOutVos&&form.trainInfoOutVos.length>0">
              <h4 class="item">学习经历</h4>
              <div class="titleBor item"></div>
              <div v-for="(item,i) in form.trainInfoOutVos" :key="i" class="borBottom item">
                <div class="jobBox">
                  <div class="label">{{item.traTime}}</div>
                  <div class="translate">{{item.institution}}</div>
                </div>
                <div class="jobBox" v-if="item.course">
                  <div class="label">课程名称</div>
                  <div class="translate">{{item.course}}</div>
                </div>
                <div class="jobBox" v-if="item.content">
                  <div class="label">培训内容</div>
                  <div class="translate">{{item.content}}</div>
                </div>
                <div class="contentBor"></div>
              </div>
            </div>
            <div class="mp advertisment"
              v-if="form.skillInfoOutVos&&form.awardInfoOutVos&&form.interest&&form.evaluation">
              <h4 class="item">自我介绍</h4>
              <div class="titleBor item"></div>
              <div class="jobBox item" v-if="form.skillInfoOutVos&&form.skillInfoOutVos.length>0">
                <div class="label">技能及特长</div>
                <div class="award">
                  <div v-for="(item,i) in form.skillInfoOutVos" :key="i">
                    <p>{{item.name}}</p>
                    <p>使用时长：{{item.useDuration}}</p>
                  </div>
                </div>
              </div>
              <div class="jobBox item" v-if="form.awardInfoOutVos&&form.awardInfoOutVos.length>0">
                <div class="label">成果及获奖情况</div>
                <div class="award">
                  <div v-for="(item,i) in form.awardInfoOutVos" :key="i">
                    <p>{{item.name}}</p>
                    <p>获得时间：{{item.gainTime}}</p>
                  </div>
                </div>
              </div>
              <div class="jobBox item" v-if="form.interest">
                <span class="label">兴趣爱好</span>
                <span class="introduce">{{form.interest}}</span>
              </div>
              <div class="jobBox item" v-if="form.evaluation">
                <span class="label">自我评价</span>
                <span class="introduce">{{form.evaluation}}</span>
              </div>
            </div>
          </div>
        </el-tab-pane>
        <el-tab-pane label="求职情况" name="second" v-if='resumeId&&invite'>
          <deliverInfo :resumeId='resumeId'></deliverInfo>
        </el-tab-pane>
      </el-tabs>
    </div>
    <el-dialog title="邀请面试" :visible.sync="dialogVisible" width="30%">
      <el-form :model="param" ref="param" :rules="rules" label-width="100px" label-position="left">
        <el-form-item label="邀请简历">
          {{form.name}}
        </el-form-item>
        <el-form-item label="面试职位" v-if="!invite" prop="jobId">
          <el-select v-model="param.jobId" filterable placeholder="请选择">
            <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="面试日期" prop="interviewTime">
          <el-date-picker v-model="param.interviewTime" type="datetime" placeholder="选择日期时间"
            value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
        </el-form-item>
        <el-form-item label="公司地址" prop="inviteddress">
          <el-input v-model="param.inviteddress" placeholder="公司地址"></el-input>
        </el-form-item>
        <el-form-item label="邀请人" prop="inviteContact">
          <el-input v-model="param.inviteContact" placeholder="邀请人"></el-input>
        </el-form-item>
        <el-form-item label="邀请人电话" prop="invitePhone">
          <el-input v-model.trim="param.invitePhone" placeholder="邀请人电话"></el-input>
        </el-form-item>
        <el-form-item label="通知内容" prop="notice">
          <el-input type="textarea" :rows="4" placeholder="请输入通知内容" v-model="param.notice"></el-input>
        </el-form-item>
        <el-form-item label="站内通知">
          <el-checkbox v-model="checkd">站内信通知</el-checkbox>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="onSubmit">确 定</el-button>
        <el-button @click="dialogVisible = false">取 消</el-button>
      </span>
    </el-dialog>
    <el-dialog title='不合适' :visible.sync="refuseVisible" width="30%">
      <el-form :model="refuseParam" ref="refuseParam" :rules="rules" label-width="100px" label-position="left">
        <el-form-item label="简历姓名">
          {{form.name}}
        </el-form-item>
        <el-form-item label="不合适原因" prop="reason">
          <el-input type="textarea" :rows="4" placeholder="请输入不合适原因" v-model="refuseParam.reason"></el-input>
        </el-form-item>
        <el-form-item label="站内通知">
          <el-checkbox v-model="checkd">站内信通知</el-checkbox>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="inappropriate">确 定</el-button>
        <el-button @click="refuseVisible = false">取 消</el-button>
      </span>
    </el-dialog>
    <el-dialog title='发起聊天' :visible.sync="chatVisible" width="30%">
      <el-form :model="chatParam" ref="chatParam" :rules="rules" label-position="left">
        <el-form-item label="选择沟通的职位" v-if="!invite" prop="jobId">
          <el-select v-model="chatParam.jobId" filterable placeholder="请选择">
            <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
          </el-select>
        </el-form-item>
        <div v-else>沟通的职位：{{job}}</div>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="chat">确 定</el-button>
        <el-button @click="chatVisible = false">取 消</el-button>
      </span>
    </el-dialog>
    <el-dialog title='举报简历' :visible.sync="reportVisible" width="30%" class="report">
      <el-form :model="report" ref="report" :rules="reportRules" label-width="100px" label-position='left'>
        <el-form-item label="简历姓名">
          <span class="label">{{form.name}}</span>
        </el-form-item>
        <el-form-item label="举报原因" prop="reason">
          <el-input type="textarea" :rows="4" placeholder="请输入举报原因" v-model="report.reason"></el-input>
        </el-form-item>
        <!-- <el-form-item label="企业名称">
          <span class="label">{{form.companyName}}</span>
        </el-form-item> -->
        <h4 class="contactInfo">联系人信息：</h4>
        <el-form-item label="联系人" prop="contact">
          <el-input v-model="report.contact" placeholder="联系人"></el-input>
        </el-form-item>
        <el-form-item label="电子邮箱" prop="mail">
          <el-input v-model="report.mail" placeholder="电子邮箱"></el-input>
        </el-form-item>
        <el-form-item label="联系电话" prop="phone">
          <el-input v-model.trim="report.phone" placeholder="联系电话"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="reportResume">举 报</el-button>
        <el-button @click="reportVisible = false">取 消</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { fetchResumeById, fetchResume, inviteInterview, getJobList, handleResume, downloadCount, deleteResume, resumeCollect, resumeUncollect, report, getConnection } from '../../../api/resume';
import { selectCompanyByUserId } from '../../../api/register'
import deliverInfo from './jobCondition'
export default {
  name: 'resume_manage',
  data () {
    let checkInterviewTime = (rule, value, callback) => {
      let today = new Date();
      let now =
        '' +
        today.getFullYear() +
        (today.getMonth() < 10 ? '0' + (today.getMonth() + 1) : today.getMonth() + 1) +
        (today.getDate() < 10 ? '0' + today.getDate() : today.getDate()) +
        (today.getHours() < 10 ? '0' + today.getHours() : today.getHours()) +
        (today.getMinutes() < 10 ? '0' + today.getMinutes() : today.getMinutes()) +
        (today.getSeconds() < 10 ? '0' + today.getSeconds() : today.getSeconds());
      console.log(now);
      let time = value
        .replace(/-/g, '')
        .replace(' ', '')
        .replace(/:/g, '');
      if (time < now) {
        callback(new Error('面试时间输入错误'));
      } else {
        callback();
      }
    };
    return {
      // 继续联系
      continuChat: false,
      chatVisible: false,
      reportVisible: false,
      activeName: 'first',
      resumeId: '',
      url: '',
      userId: '',
      id: [],
      loading: false,
      collected: false,
      deliverId: '',
      invite: false,
      contact: false,
      didInappropriate: true,
      dialogVisible: false,
      refuseVisible: false,
      didInvite: true,
      didIntent: true,
      didRefuse: true,
      form: {},
      report: {
        reason: '',
        mail: '',
        phone: '',
        contact: ''
      },
      chatParam: {
        jobId: ''
      },
      param: {
        status: 4,
        userId: '',
        resumeId: '',
        jobId: '',
        interviewTime: '',
        inviteddress: '',
        inviteContact: '',
        invitePhone: null,
        notice: ''
      },
      checkd: true,
      refuseParam: {
        reason: ''
      },
      options: [],
      rules: {
        notice: [{ required: true, message: '请输入通知内容', trigger: 'blur' }],
        jobId: [{ required: true, message: '请选择面试职位', trigger: 'blur' }],
        interviewTime: [{ required: true, message: '请选择面试时间', trigger: 'blur' }, { validator: checkInterviewTime }],
        inviteddress: [{ required: true, message: '请输入公司地址', trigger: 'blur' }],
        inviteContact: [{ required: true, message: '请输入邀请人姓名', trigger: 'blur' }],
        invitePhone: [{ required: true, message: '请输入邀请人电话', trigger: 'blur' }, { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码', trigger: 'change' }],
        reason: [{ required: true, message: '请输入不合适原因', trigger: 'blur' }]
      },
      reportRules: {
        reason: [{ required: true, message: '请输入举报原因', trigger: 'blur' }, { max: 200, message: '原因不能超过200字', trigger: 'blur' }],
        phone: [{ required: true, message: '请输入手机号码', trigger: 'blur' }, { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码', trigger: 'change' }],
        mail: [{ required: true, message: '请输入电子邮箱', trigger: 'blur' }, {
          pattern: /^[A-Za-z0-9]+([_\.A-Za-z0-9\-]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/,
          message: '请输入正确的邮箱',
          trigger: 'change'
        }],
        contact: [{ required: true, message: '请输入联系人', trigger: 'blur' }]
      }
    };
  },
  components: {
    deliverInfo
  },
  computed: {
    job () {
      let job = '';
      this.options.forEach(i => {
        if (i.id === this.chatParam.jobId) {
          job = i.name
        }
      })
      return job;
    }
  },
  created () {
    this.userId = localStorage.getItem('ep_userId')
    this.url = process.env.VUE_APP_URL || '';
    getJobList().then(data => {
      console.log(data);
      if (data.success) {
        this.options = data.data || [];
      } else {
        this.$message.error(`${data.msg}`);
      }
    });
    selectCompanyByUserId().then(res => {
      if (res.success) {
        this.param.inviteddress = res.data.address;
        this.param.inviteContact = res.data.contact;
        this.param.invitePhone = res.data.contactPhone;
      }
    })
    console.log(this);
    if (this.$route.query.path) {
      this.invite = false;
      if (this.$route.query.id) {
        let formFata = new FormData();
        // formFata.append('deliverId', this.$route.query.deliverId)
        // formFata.append('status', this.$route.query.status)
        // formFata.append('id', this.$route.query.resumeId)
        fetchResumeById(this.$route.query.id).then(data => {
          console.log(data);
          if (data.success) {
            this.form = data.data;
            this.contact = true;
            this.collected = data.data.collect;
            this.param.userId = this.$route.query.userId;
            this.param.resumeId = data.data.id;
            this.resumeId = data.data.id;
            this.id.push(data.data.id);
          } else if (data.code === 490) {
            this.$message.error(`${data.msg}`);
            this.$router.push({ path: '/' });
          } else {
            this.$message.error(`${data.msg}`);
            this.$router.push({ path: '/talentPool' });
          }
        });

      }
    } else {
      this.invite = true;
      this.id.push(this.$route.query.resumeId);
      let formFata = new FormData();
      formFata.append('deliverId', this.$route.query.deliverId);
      formFata.append('status', this.$route.query.status);
      formFata.append('id', this.$route.query.resumeId);
      if (this.$route.query.status == 3 || this.$route.query.status == 4) {
        this.didInvite = false;
        this.contact = true;
      } else if (this.$route.query.status == 5) {
        this.didRefuse = false;
        this.contact = true;
        this.didInappropriate = false;
      }
      fetchResume(formFata).then(data => {
        console.log(data);
        if (data.success) {
          this.form = data.data;
          this.collected = data.data.collect;
          this.param.userId = this.$route.query.userId;
          this.param.resumeId = this.$route.query.resumeId;
          this.chatParam.jobId = this.$route.query.jobId;
          this.resumeId = this.$route.query.resumeId;
          this.param.jobId = this.$route.query.jobId;
          this.deliverId = this.$route.query.deliverId;
          console.log(this.form);
        } else {
          this.$message.error(`${data.msg}`);
          this.$router.push({ path: '/resume' });
        }
      });
    }
  },
  watch: {
    resumeId: function (val) {
      console.log(val);

    }
  },
  methods: {
    // 举报
    reportResume () {
      this.$refs.report.validate(valid => {
        if (valid) {
          let query = {
            resumeId: this.param.resumeId,
            resumeName: this.form.title,
            // companyId: "0c7f6404c7a63ead2b6ebf22e2877379",
            // companyName: "易通企业",
            ...this.report
          }
          report(query).then(res => {
            console.log(res);
            if (res.success) {
              this.$message.success('举报成功!')
            } else {
              this.$message.error(`${res.msg}`)
            }
            this.reportVisible = false;
          });
        } else {
          // this.$message.error('请输入账号和密码');
          console.log('error submit!!');
          return false;
        }
      });
    },
    // 收藏简历
    collection () {
      if (!this.collected) {
        resumeCollect(this.id).then(res => {
          if (res.success) {
            this.collected = true;
          } else {
            this.$message.error(`${res.msg}`)
          }
        })
      } else {
        resumeUncollect(this.id[0]).then(res => {
          if (res.success) {
            this.collected = false;
          } else {
            this.$message.error(`${res.msg}`)
          }
        })
      }
      console.log(this.collected);
    },
    // 有意向
    intention () {
      let query = {
        deliverId: this.deliverId,
        userId: this.param.userId,
        jobId: this.param.jobId,
        status: 3,
        resumeId: this.param.resumeId,
        notice: '',
        interviewTime: '',
        checkd: true
      };
      handleResume([query]).then(data => {
        if (data.success) {
          this.contact = true;
          this.didIntent = false;
        } else {
          this.$message.error(`${data.msg}`);
        }
      });
    },
    // 邀请面试
    inviteInterview () {
      this.dialogVisible = true;
    },
    refuse () {
      this.refuseVisible = true;
    },
    // 不合适
    inappropriate () {
      // inviteInterview(this.param).then(data => {});
      this.$refs.refuseParam.validate(valid => {
        if (valid) {
          let query = {
            deliverId: this.deliverId,
            userId: this.param.userId,
            jobId: this.param.jobId,
            status: 5,
            resumeId: this.param.resumeId,
            notice: this.refuseParam.reason,
            interviewTime: '',
            checkd: this.checkd
          };
          handleResume([query]).then(data => {
            if (data.success) {
              this.didRefuse = false;
            } else {
              this.$message.error(`${data.msg}`);
            }
            this.refuseVisible = false;
          });
        } else {
          // this.$message.error('请输入账号和密码');
          console.log('error submit!!');
          return false;
        }
      });
    },
    // 删除简历
    deleteResume () {
      this.$confirm('您要删除简历，删除后不可恢复，是否确定操作？', '信息提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        callback: action => {
          if (action === 'confirm') {
            deleteResume([this.deliverId]).then(res => {
              if (res.success) {
                this.$message.success('删除成功')
                this.$router.push({ path: '/resume' });
              } else {
                this.$message.error(`${res.msg}`)
              }
            })
          }
        }
      });
    },
    // 下载简历
    downloadResume () {
      // console.log(this.$refs.print);
      // this.selectBox = false;
      this.loading = true;
      downloadCount({ resumeIds: [this.form.id] }).then(data => {
        if (data.success) {
          window.open(this.url + '/zsrencai/api/company/resume-load/resume-info/' + this.form.id, '_blank')
          // this.ExportSavePdf('简历详情', this.$refs.print);
          // this.selectBox = true;
          this.loading = false;
        } else {
          this.loading = false;
          this.$message.error(`${data.msg}`);
        }
      });
    },
    // 聊天
    chat () {
      this.$refs.chatParam.validate(valid => {
        if (valid) {
          let query = {
            jobId: this.chatParam.jobId,
            resumeId: this.param.resumeId,
            senderUserId: this.userId,
            senderUserAccountType: 2,
            receiverUserId: this.param.userId,
            receiverUserAccountType: 1,
            // senderUserName: '招聘者',
            receiverUserName: this.form.name
          }
          getConnection(query).then(res => {
            if (res.success) {
              this.$router.push('/chat')
              this.chatVisible = false;
            } else {
              this.$message.error(res.msg)
            }
          })
        } else {
          return false
        }
      })
    },
    // 邀请面试
    onSubmit () {
      if (this.invite) {
        this.$refs.param.validate(valid => {
          if (valid) {
            let query = {
              deliverId: this.deliverId,
              userId: this.param.userId,
              jobId: this.param.jobId,
              status: 4,
              resumeId: this.param.resumeId,
              inviteContact: this.param.inviteContact,
              invitePhone: this.param.invitePhone,
              inviteddress: this.param.inviteddress,
              notice: this.param.notice,
              interviewTime: this.param.interviewTime,
              checkd: this.checkd
            };
            handleResume([query]).then(data => {
              if (data.success) {
                this.contact = true;
                this.didInvite = false;
              } else {
                this.$message.error(`${data.msg}`);
              }
              this.dialogVisible = false;
            });
          } else {
            // this.$message.error('请输入账号和密码');
            console.log('error submit!!');
            return false;
          }
        });
      } else {
        this.$refs.param.validate(valid => {
          if (valid) {
            inviteInterview([{ ...this.param, checkd: this.checkd }]).then(data => {
              console.log(data);
              if (data.success) {
                this.contact = true;
                this.didInvite = false;
              } else {
                this.$message.error(`${data.msg}`);
              }
              this.dialogVisible = false;
            });
          } else {
            // this.$message.error('请输入账号和密码');
            console.log('error submit!!');
            return false;
          }
        });
      }
    }
  }
};
</script>

<style lang="css" scoped>
.resume_manage {
    width: 1200px;
    background: rgba(255, 255, 255, 1);
    opacity: 1;
    position: relative;
}

.resume_manage h1 {
    height: 69px;
    border-bottom: 1px solid rgba(232, 232, 232, 1);
    line-height: 69px;
    font-size: 20px;
    font-family: PingFang SC;
    font-weight: 600;
    line-height: 69px;
    color: rgba(34, 34, 34, 1);
    opacity: 1;
    padding-left: 45px;
}
.resume_manage .resumeInfo {
    padding: 0 45px 40px;
}
.resume_manage .resumeInfo .personalInfo {
    /* border-bottom: 1px solid rgba(232, 232, 232, 1); */
    padding: 40px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.personalContent {
    display: flex;
    align-items: flex-start;
}
.personalContent img {
    width: 72px;
    height: 72px;
    background: url('../../../assets/img/logo.png') no-repeat;
    background-size: 100% 100%;
    border-radius: 50%;
    margin-right: 38px;
    opacity: 1;
}
.personalContent img.girl {
    background: url('../../../assets/img/logoG.png') no-repeat;
    background-size: 100% 100%;
}
.personalContent h3 {
    height: 22px;
    font-size: 16px;
    font-family: PingFang SC;
    font-weight: 500;
    line-height: 22px;
    color: rgba(34, 34, 34, 1);
    opacity: 1;
}
.personalContent p {
    margin-top: 8px;
    height: 20px;
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 400;
    line-height: 20px;
    color: rgba(34, 34, 34, 1);
    opacity: 1;
}
.sub-box {
    margin-top: 20px;
}
.download {
    position: absolute;
    right: 50px;
    top: 150px;
    display: flex;
    align-items: flex-start;
}
.download .btnBox {
    display: flex;
    flex-direction: column;
    margin-left: 56px;
}
.download .btnBox .el-button {
    width: 216px;
    height: 46px;
    margin: 0 0 18px;
}
.collection {
    margin-top: 10px;
    height: 26px;
    font-size: 16px;
    font-family: PingFang SC;
    font-weight: 400;
    line-height: 26px;
    color: rgba(85, 85, 85, 1);
    cursor: pointer;
    opacity: 1;
}
.icon {
    display: inline-block;
    vertical-align: top;
    margin-right: 13px;
    width: 25px;
    height: 24px;
    background: url('../../../assets/img/uncollection.png') no-repeat;
    background-size: 100% 100%;
}
.icon.active {
    background: url('../../../assets/img/collection.png') no-repeat;
    background-size: 100% 100%;
}
.mp {
    margin-top: 40px;
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 400;
    color: rgba(34, 34, 34, 1);
    opacity: 1;
}
.mp h4 {
    height: 20px;
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 500;
    line-height: 20px;
    color: rgba(34, 34, 34, 1);
    opacity: 1;
}
.mp .titleBor {
    width: 28px;
    height: 2px;
    background: rgba(24, 147, 252, 1);
    opacity: 1;
    border-radius: 2px;
}
.mp .select {
    margin: 20px 0;
}
.mp .select .el-button {
    width: 120px;
    height: 40px;
    margin-right: 44px;
}
.mp p {
    height: 20px;
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 400;
    line-height: 20px;
    color: rgba(34, 34, 34, 1);
    opacity: 1;
}
.education p {
    margin-top: 20px;
}
.mp .desc {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.mp .desc p {
    margin-top: 20px;
}
.mp .jobBox {
    display: flex;
    flex-direction: row;
    margin-top: 20px;
}
.mp .jobBox .label {
    width: 112px;
    height: 20px;
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 400;
    line-height: 20px;
    color: rgba(34, 34, 34, 1);
    text-align: right;
    opacity: 1;
}
.mp .jobBox .translate {
    margin-left: 38px;
    width: 850px;
}
.award {
    margin-left: 38px;
}
.award div {
    margin-bottom: 20px;
}
.award p {
    display: inline-block;
    width: 160px;
    margin-right: 60px;
}
.mp .lang {
    margin-right: 130px;
    display: flex;
    flex-direction: row;
}
.lang p {
    margin-top: 20px;
    margin-right: 30px;
}
.advertisment .jobBox .translate {
    width: 160px;
}
.advertisment .jobBox .translate p {
    margin-bottom: 20px;
}
.contentBor {
    margin-left: 145px;
    margin-top: 19px;
    width: 850px;
    height: 0px;
    border: 0.5px solid rgba(232, 232, 232, 1);
    opacity: 1;
}
.label {
    margin-right: 10px;
}

.introduce {
    width: 500px;
    margin-left: 38px;
    line-height: 20px;
}
.el-form .el-form-item /deep/ .el-textarea__inner {
    display: inline-block;
    width: 100%;
}

.report .el-form .el-form-item /deep/ .el-form-item__error {
    left: 0;
}
.el-form-item {
    margin-bottom: 20px;
}
.report .el-form {
    margin-left: 10px;
}
.reportBox {
    position: absolute;
    width: 60px !important;
    height: 60px !important;
    font-size: 16px;
    right: 0;
    top: -48px;
}
.contactInfo {
    margin-bottom: 20px;
    margin-left: -10px;
}
</style>